package com.smile.api;


import com.smile.commons.page.R;
import com.smile.model.dto.request.GetMenusByModuleTypeRequest;
import com.smile.model.response.GetMenusByRoleIdResponse;
import com.smile.model.response.ShowMenuListResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(name = "smile-plus-standalone-user"
        , contextId = "menu",
        path = "/api/user")
public interface MenuApi {

    @PostMapping(value = "/menu/getMenusByRoleId", produces = MediaType.APPLICATION_JSON_VALUE)
    R<List<GetMenusByRoleIdResponse>> getMenusByRoleId(@RequestBody Long id);


    @PostMapping(value = "/menu/list", produces = MediaType.APPLICATION_JSON_VALUE)
    R<List<ShowMenuListResponse>> list();

    @PostMapping(value = "/menu/listAll", produces = MediaType.APPLICATION_JSON_VALUE)
    R<List<ShowMenuListResponse>> listAll();

    @PostMapping(value = "/menu/getMenusByModuleType")
    R<List<ShowMenuListResponse>> getMenusByModuleType(@RequestBody GetMenusByModuleTypeRequest request);

    @GetMapping(value = "/menu/getMenusByModuleTypeAll")
    R<List<ShowMenuListResponse>> getMenusByModuleTypeAll();

    @GetMapping(value = "/menu/getModules")
    R<List<Integer>> getModules();
}
